package com.googlecode.bip.dao.utils;

import java.sql.SQLException;
import java.util.Map;
import javax.naming.NamingException;

/**
 * Build a {@link Map} of item T from a SQL query
 *
 * @see MappableInstance
 */
public interface MappableGetter<K,V>
{
    /**
     * Build a {@link Map} of item T from a SQL query
     *
     * @param sql SQL query to find T item in data base
     * @return a {@link Map} of <XMP><K,V></XMP> (not null)
     * @throws SQLException if any
     * @throws NamingException if any
     */
    public Map<K,V> getMap( String sql ) throws SQLException, NamingException;
}
